﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Domzs.Extensions
{
    public interface IComposite<T>
    {
        T Parent { get; }
        IEnumerable<T> Children { get; }
    }

    public class CompositeThing : IComposite<CompositeThing>
    {
        public CompositeThing()
        {
            Children = new List<CompositeThing>();
        }

        public string Name { get; set; }
        public CompositeThing Parent { get; set; }
        public IEnumerable<CompositeThing> Children { get; set; }
    }
}
